imgr = new Array();
imgr[0] = &quot;https://vbcomp.googlecode.com/svn/trunk/img/thumnails.gif&quot;;
showRandomImg = true;
aBold = true;
summaryPost= 180; //
rsummaryPost = 160;
summaryTitle = 35; //
hposts=6;
numposts = 10; //
fposts=10;//
home_page = &quot;<data:blog.homepageUrl/>&quot;;

function removeHtmlTag(strx,chop){
     var s = strx.split(&quot;&lt;&quot;);
	 for(var i=0;i&lt;s.length;i++){
    	 if(s[i].indexOf(&quot;&gt;&quot;)!=-1){
    		 s[i] = s[i].substring(s[i].indexOf(&quot;&gt;&quot;)+1,s[i].length);
 		 }
		 }
		 s =  s.join(&quot;&quot;);
		 s = s.substring(0,chop-1);
		 return s;
}


function showfeatureposts(json) {
	j = (showRandomImg) ? Math.floor((imgr.length+1)*Math.random()) : 0;
	img  = new Array();
    document.write(&#39;&lt;ul class=&quot;clearfix&quot; style=&quot;position: relative; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&#39;);

  	for (var i = 0; i &lt; numposts; i++) {
    	var entry = json.feed.entry[i];
    	var posttitle = entry.title.$t;
		var pcm;
    	var posturl;
    	if (i == json.feed.entry.length) break;
    	for (var k = 0; k &lt; entry.link.length; k++) {
      		if (entry.link[k].rel == &#39;alternate&#39;) {
        		posturl = entry.link[k].href;
        		break;
      		}
    	}

		for (var k = 0; k &lt; entry.link.length; k++) {
      		if (entry.link[k].rel == &#39;replies&#39; &amp;&amp; entry.link[k].type == &#39;text/html&#39;) {
        		pcm = entry.link[k].title.split(&quot; &quot;)[0];
        		break;
      		}
    	}

    	if (&quot;content&quot; in entry) {
      		var postcontent = entry.content.$t;}
    	else
    	if (&quot;summary&quot; in entry) {
      		var postcontent = entry.summary.$t;}
    	else var postcontent = &quot;&quot;;

    	postdate = entry.published.$t;

	if(j&gt;imgr.length-1) j=0;
	img[i] = imgr[j];

	s = postcontent	; a = s.indexOf(&quot;&lt;img&quot;); b = s.indexOf(&quot;src=\&quot;&quot;,a); c = s.indexOf(&quot;\&quot;&quot;,b+5); d = s.substr(b+5,c-b-5);

	if((a!=-1)&amp;&amp;(b!=-1)&amp;&amp;(c!=-1)&amp;&amp;(d!=&quot;&quot;)) img[i] = d;




	var month = [1,2,3,4,5,6,7,8,9,10,11,12];
	var month2 = [&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;,&quot;Sep&quot;,&quot;Oct&quot;,&quot;Nov&quot;,&quot;Dec&quot;];

	var day = postdate.split(&quot;-&quot;)[2].substring(0,2);
	var m = postdate.split(&quot;-&quot;)[1];
	var y = postdate.split(&quot;-&quot;)[0];

	for(var u2=0;u2&lt;month.length;u2++){
		if(parseInt(m)==month[u2]) {
			m = month2[u2] ; break;
		}
	}


	var daystr = day+ &#39; &#39; + m + &#39; &#39; + y ;


	var trtd = &#39;&lt;li id=&quot;main-post-&#39;+i+&#39;&quot;&gt; &lt;div class=&quot;entry clearfix&quot;&gt; &lt;a href=&quot;&#39;+posturl+&#39;&quot;&gt;&lt;img class=&quot;post_thumbnail thumbnail  &quot; src=&quot;&#39;+img[i]+&#39;&quot;&gt;&lt;/a&gt;&lt;h2 class=&quot;post-title&quot; &gt;&lt;a href=&quot;&#39;+posturl+&#39;&quot;&gt;&#39;+posttitle+&#39;&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;&#39;+removeHtmlTag(postcontent,summaryPost)+&#39; ...&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;meta&quot;&gt; &lt;span class=&quot;meta-date&quot;&gt; &#39;+daystr+&#39; &lt;/span&gt;|  &lt;span class=&quot;meta-comments&quot;&gt; &lt;a  href=&quot;&#39;+posturl+&#39;#comments&quot;&gt;&#39;+pcm+&#39; comments&lt;/a&gt;&lt;a class=&quot;more-link&quot; title=&quot;&#39;+posttitle+&#39;&quot; href=&quot;&#39;+posturl+&#39;&quot;&gt;View Post&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&#39;;


	document.write(trtd);

	j++;
}
document.write(&#39;&lt;/ul&gt;&#39;);

}

function showrecentposts(json) {
	j = (showRandomImg) ? Math.floor((imgr.length+1)*Math.random()) : 0;
	img  = new Array();

  	for (var i = 0; i &lt; fposts; i++) {
    	var entry = json.feed.entry[i];
    	var posttitle = entry.title.$t;
		var pcm;
    	var posturl;
    	if (i == json.feed.entry.length) break;
    	for (var k = 0; k &lt; entry.link.length; k++) {
      		if (entry.link[k].rel == &#39;alternate&#39;) {
        		posturl = entry.link[k].href;
        		break;
      		}
    	}

		for (var k = 0; k &lt; entry.link.length; k++) {
      		if (entry.link[k].rel == &#39;replies&#39; &amp;&amp; entry.link[k].type == &#39;text/html&#39;) {
        		pcm = entry.link[k].title.split(&quot; &quot;)[0];
        		break;
      		}
    	}

    	if (&quot;content&quot; in entry) {
      		var postcontent = entry.content.$t;}
    	else
    	if (&quot;summary&quot; in entry) {
      		var postcontent = entry.summary.$t;}
    	else var postcontent = &quot;&quot;;

    	postdate = entry.published.$t;

	if(j&gt;imgr.length-1) j=0;
	img[i] = imgr[j];

	s = postcontent	; a = s.indexOf(&quot;&lt;img&quot;); b = s.indexOf(&quot;src=\&quot;&quot;,a); c = s.indexOf(&quot;\&quot;&quot;,b+5); d = s.substr(b+5,c-b-5);

	if((a!=-1)&amp;&amp;(b!=-1)&amp;&amp;(c!=-1)&amp;&amp;(d!=&quot;&quot;)) img[i] = d;




	var month = [1,2,3,4,5,6,7,8,9,10,11,12];
	var month2 = [&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;,&quot;Sep&quot;,&quot;Oct&quot;,&quot;Nov&quot;,&quot;Dec&quot;];

	var day = postdate.split(&quot;-&quot;)[2].substring(0,2);
	var m = postdate.split(&quot;-&quot;)[1];
	var y = postdate.split(&quot;-&quot;)[0];

	for(var u2=0;u2&lt;month.length;u2++){
		if(parseInt(m)==month[u2]) {
			m = month2[u2] ; break;
		}
	}


	var daystr = day+ &#39; &#39; + m + &#39; &#39; + y ;


	var trtd = &#39;&lt;li &gt;        &lt;a href=&quot;&#39;+posturl+&#39;&quot;&gt;&#39;+posttitle+&#39;&lt;/a&gt;        &lt;/li&gt;&#39;;

	document.write(trtd);

	j++;
}

}

function showrecentcomments(json) {
for (var i = 0; i &lt; 4; i++) {
var entry = json.feed.entry[i];
var ctlink;
if (i == json.feed.entry.length) break;
for (var k = 0; k &lt; entry.link.length; k++) {
if (entry.link[k].rel == &#39;alternate&#39;) {
ctlink = entry.link[k].href;
break;
}
}
if (&quot;content&quot; in entry) {
var comment = entry.content.$t;}
else
if (&quot;summary&quot; in entry) {
var comment = entry.summary.$t;}
else var comment = &quot;&quot;;
var re = /&lt;\S[^&gt;]*&gt;&gt;/g;
comment = comment.replace(re, &quot;&quot;);
document.write(&#39;&lt;li&gt;&#39;);
document.write(&#39;&lt;a href=&quot;&#39; + ctlink + &#39;&quot;&gt;&lt;span&gt;&lt;b&gt;&#39; + entry.author[0].name.$t + &#39;&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; says:&#39;);
if (comment.length &lt; 100) {
document.write(&#39;&lt;a target=&quot;_blank&quot; href=&quot;&#39; + ctlink + &#39;&quot;&gt; &#39;+comment + &#39;&lt;/a&gt;&#39;);
}
else
{
comment = comment.substring(0, 100);
var quoteEnd = comment.lastIndexOf(&quot; &quot;);
comment = comment.substring(0, quoteEnd);
document.write(&#39;&lt;a target=&quot;_blank&quot; href=&quot;&#39; + ctlink + &#39;&quot;&gt; &#39;+comment + &#39;...&lt;/a&gt;&#39;);
}
}
document.write(&#39;&lt;/li&gt;&#39;);
}